package com.central.post.service

import com.baomidou.mybatisplus.extension.plugins.pagination.Page
import com.central.common.entity.Post
import com.central.common.model.CommonResult
import com.central.common.model.PageVo
import com.central.common.model.SysUser
import com.central.common.service.ISuperService
import com.central.post.pojo.post.*

/**
 * @author  fly
 * @date  2021/5/26 14:50
 * @version 1.0
 */
interface PostService : ISuperService<Post> {

    /**
     * 插入或者更新帖子
     */
    fun insertOrUpdatePost(postSaveOrUpdateDto: PostSaveOrUpdateDto, sysUser: SysUser): CommonResult<Boolean>

    /**
     * 获取帖子列表
     */
    fun getPostList(postDto: PostDto, sysUser: SysUser): CommonResult<Page<PostVo>>

    /**
     * 获取帖子详情
     */
    fun getPostDetail(postDto: PostDto, sysUser: SysUser): CommonResult<PostVo>

    /**
     * 移除帖子
     */
    fun removePost(id: Long, sysUser: SysUser): CommonResult<Boolean>

    /**
     * 回复话题帖子
     */
    fun insertOrUpdateTopicPost(topicPostSaveDto: TopicPostSaveDto, sysUser: SysUser): CommonResult<Boolean>

    /**
     * 获取话题帖子详情信息
     */
    fun getTopicDetail(topicId: Long, sysUser: SysUser): CommonResult<TopicPostDetailVo>

    /**
     * 获取话题帖子列表信息
     */
    fun getTopicPostList(topicPostSearchDto: TopicPostSearchDto, pageVo: PageVo, sysUser: SysUser): CommonResult<Page<PostVo>>

    /**
     * 获取所有的帖子列表
     */
    fun getAllPostList(type: Int, sysUser: SysUser, pageVo: PageVo): CommonResult<Page<PostVo>>


    /**
     * (rpc) 获取我获得的总赞数
     */
    fun getMyPostLikeNum(userId: Long): Long

    /**
     * (rpc) 获取帖子详情
     */
    fun getPostDetail(id: Long): Post?


    /**
     * (后台管理系统) 发布话题贴
     */
    fun publishTopicPost(backPostSaveOrUpdateDto: BackPostSaveOrUpdateDto, userId: Long): CommonResult<Boolean>
}